package com.hgxd.entity.authentication;

import lombok.Data;
import org.springframework.security.core.userdetails.User;
import com.hgxd.entity.pojo.SysUser;

import java.util.Collections;

/**
 * @author wtf
 * @create 2023-07-24 17:42
 * @description : 用来继承spring security中提供的User对象
 */
public class CustomUser extends User {
    private SysUser sysUser ;
    public CustomUser(SysUser sysUser){
        super(sysUser.getUsername(), sysUser.getPassword(), Collections.emptyList());
        this.sysUser = sysUser ;
    }

    public SysUser getSysUser() {
        return sysUser;
    }

    public void setSysUser(SysUser sysUser) {
        this.sysUser = sysUser;
    }
}
